<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理区域</title>
<load type="css" href='__PUBLIC__/Css/myPage.css' />
<load type="css" href='__PUBLIC__/Css/common.css' />
<load href="__PUBLIC__/Js/jquery-1.4.min.js" />
<load href="__PUBLIC__/Js/common.js" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {font-size: 12px}
.STYLE3 {font-size: 12px; font-weight: bold; }
.STYLE4 {
	color: #03515d;
	font-size: 12px;
}
-->
</style>

<script>
var URL = '__URL__';
var  highlightcolor='#c1ebff';
var selectAll = function(obj){
	obj=jQuery(obj);
	var flag=obj.attr('checked')?true:false;
		jQuery(":checkbox").attr('checked',flag);

}

var delAllSelect = function(){
	var checkedvalue = "";
	var checkbox = jQuery("input:checked");
	if(checkbox.length==0){
		alert('请选择锁定项！');
		return false;	
	}
	if (window.confirm('确实要删除选择项吗？')){
		var card_id = "";
		for(i=0;i<checkbox.length;i++){
			var tempValue = checkbox[i].value.split(",");
			card_id += tempValue[0]+",";
		}
		checkedvalue = card_id.substring(0,card_id.length-1);
		document.getElementById('id').value = checkedvalue;
		document.getElementById('form1').submit();
	}
}
var outCsv = function(){
	//var checkflag = jQuery("input[name='checkbox_all']").attr('checked');
	var checkedvalue = "";
	var checkbox = jQuery("input:checked");
	if(checkbox.length==0){
		jQuery("#searchForm").attr('action','__URL__/outCsv');
		jQuery("#searchForm").submit();
	}else{
		var card_id = "";
		var card_password = "";
		var card_amount = "";
		var card_generatedate = "";
		for(i=0;i<checkbox.length;i++){
			var tempValue = checkbox[i].value.split(",");
			card_id += tempValue[0]+",";
			card_password += tempValue[1]+",";
			card_amount += tempValue[2]+",";
			card_generatedate += tempValue[3]+",";
			//checkedvalue += checkbox[i].value+",";
		}
		checkedvalue = checkedvalue.substring(0,checkedvalue.length-1);
		jQuery("#card_id").attr('value',card_id);
		jQuery("#card_password").attr('value',card_password);
		jQuery("#card_amount").attr('value',card_amount);
		jQuery("#card_generatedate").attr('value',card_generatedate);
		jQuery("#formCsv").submit();
	}
}
</script>

</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="__PUBLIC__/Images/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="__PUBLIC__/Images/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="__PUBLIC__/Images/tb.gif" width="16" height="16" /></div></td>
                <td width="95%" class="STYLE1"><span class="STYLE3">你当前的位置</span>：[充值卡列表]</td>
              </tr>
            </table></td>
            <td width="54%"><table border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td width="60"><table width="87%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="STYLE1"><div align="center">
                      <input type="checkbox" name="checkbox_all" value="checkbox" onclick="javascript:selectAll(this)" />
                    </div></td>
                    <td class="STYLE1"><div align="center">全选</div></td>
                  </tr>
                </table></td>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="STYLE1"><div align="center"><a href="add()"><img src="__PUBLIC__/Images/22.gif" width="14" height="14" /></a></div></td>
                    <td class="STYLE1"><div align="center">新增</div></td>
                  </tr>
                </table></td>
                <td width="60"><table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="STYLE1"><div align="center"><a href="eidt()"><img src="__PUBLIC__/Images/33.gif" width="14" height="14" /></a></div></td>
                    <td class="STYLE1"><div align="center">修改</div></td>
                  </tr>
                </table></td>
                <td width="52"><table width="88%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="STYLE1"><div align="center"><a href="javascript:delAllSelect();"><img src="__PUBLIC__/Images/11.gif" width="14" height="14" /></a></div></td>
                    <td class="STYLE1"><div align="center">删除</div></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="16"><img src="__PUBLIC__/Images/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
  	<td>
  		<div style="margin:5px;padding:5px;border:1px solid #BBDDE5;">
  		<form method="post" id="searchForm" name="searchForm" action="__URL__/Search" enctype="multipart/form-data">
  			<img src="__PUBLIC__/Images/icon_search.gif" />&nbsp;&nbsp;
  			充值卡卡号：<input type="text" name="card_id" size=16 maxlength=16 value="{$post.card_id}"/>&nbsp;&nbsp;
  			面值：
  				<select name="card_amount">
  					<option value="0" <if condition="($post.card_amount eq '0') or (!isset($post))">selected=true;</if>>全部 </option>
  					<option value="10" <if condition="($post.card_amount eq '10')">selected=true;</if>>10  </option>
  					<option value="20" <if condition="($post.card_amount eq '20')">selected=true;</if>>20  </option>
  					<option value="50" <if condition="($post.card_amount eq '50')">selected=true;</if>>50 </option>
  					<option value="100" <if condition="($post.card_amount eq '100')">selected=true;</if>>100 </option>
                    <option value="500" <if condition="($post.card_amount eq '500')">selected=true;</if>>500 </option>
                    <option value="1000" <if condition="($post.card_amount eq '1000')">selected=true;</if>>1000 </option>
  				</select>&nbsp;点&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  			  状态：
  				<select name="card_static">
  					<option value="3" <if condition="($post.card_static eq '3') or (!isset($post))">selected=true;</if>>全部 </option>
  					<option value="0" <if condition="($post.card_static eq '0')">selected=true;</if>>正常</option>
  					<option value="1" <if condition="($post.card_static eq '1')">selected=true;</if>>已导出 </option>
  					<option value="2" <if condition="($post.card_static eq '2')">selected=true;</if>>已充值</option>
  				</select>&nbsp;&nbsp;&nbsp;
  			<input type="submit" value="搜索"/><span class="errmsg" style="margin-left:10px;color:red">{$errmsg}</span><input style="float:right;" type="button" onclick="javascript:outCsv();" value="导出csv"/>
  		</form>
  		<input type="hidden" id="suser_id" value="{$post.card_id}"/>
  		<input type="hidden" id="suser_realname" value="{$post.card_amount}"/>
  		<input type="hidden" id="store_name" value="{$post.card_static}"/>
  		</div>
  	</td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0"  id="checkList">
      <tr>
        <td width="8" background="__PUBLIC__/Images/tab_12.gif">&nbsp;</td>
        <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#b5d6e6">
          <tr>
            <td width=3%" height="22" background="__PUBLIC__/Images/bgTab.gif"><div align="center">
              <input type="checkbox" name="checkbox" value="checkbox" onclick="javascript:selectAll(this)" />
            </div></td>
            <td width="15%" height="22"background="__PUBLIC__/Images/bgTab.gif">
            	<div align="center">
            		<span class="STYLE1">充值卡卡号</span>
            	</div>
            </td>
            <td width="10%" height="22" background="__PUBLIC__/Images/bgTab.gif">
            	<div align="center">
           			<span class="STYLE1">充值卡密码</span>
            	</div>
            </td>
            <td width="10%" height="22" background="__PUBLIC__/Images/bgTab.gif">
            	<div align="center">
            		<span class="STYLE1">面值</span>
            	</div>
            </td>
            <td width="10%" height="22" background="__PUBLIC__/Images/bgTab.gif">
            	<div align="center">
            		<span class="STYLE1">状态</span>
            	</div>
            </td>
            <td width="10%" height="22" background="__PUBLIC__/Images/bgTab.gif">
           		<div align="center">
           			<span class="STYLE1">充值用户</span>
           		</div>
           	</td>
            <td width="15%" height="22" background="__PUBLIC__/Images/bgTab.gif">
            	<div align="center">
            		<span class="STYLE1">充值时间</span>
            	</div>
            </td>
            <td width="15%" height="22" background="__PUBLIC__/Images/bgTab.gif">
            	<div align="center">
            		<span class="STYLE1">生成时间</span>
            	</div>
            </td>
            <td width="20%" background="__PUBLIC__/Images/bgTab.gif"><div align="center"><span class="STYLE1">基本操作</span></div></td>
          </tr>
          <volist name="list" id="vo">
          <tr>
            <td height="20" bgcolor="#FFFFFF"><div align="center">
              <input type="checkbox" name="checkbox{$key}"  value="{$vo.card_id},{$vo.card_password},{$vo.card_amount},{$vo.card_generatedate}" name="key" />
            </div></td>
            <td height="20" bgcolor="#FFFFFF"><div style="padding-left:2em;" class="STYLE1">
              <div>{$vo.card_id}</div>
            </div></td>
            <td height="20" bgcolor="#FFFFFF"><div style="padding-left:2em;"><span class="STYLE1">{$vo.card_password}</span></div></td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">{$vo.card_amount}</span></div></td>
            <td height="20" bgcolor="#FFFFFF">
            	<div align="center">
            		<span class="STYLE1">
	            		<switch name="vo.card_static">
	                        <case value="0">正常</case>
	                        <case value="1">已导出</case>
	                        <case value="2">已充值</case>
	      	            </switch>
            		</span>
            	</div>
            </td>
            <td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">{$vo.card_userid}</span></div></td>
            <td height="20" bgcolor="#FFFFFF">
            	<div align="center">
	            	<span class="STYLE1">
	            		<if condition="($vo.card_paiddate neq '0000-00-00 00:00:00')">
	            		{$vo.card_paiddate}
	            		</if>
	            	</span>
	            </div>
	        </td>
			<td height="20" bgcolor="#FFFFFF"><div align="center"><span class="STYLE1">{$vo.card_generatedate}</span></div></td>
            <td height="20" bgcolor="#FFFFFF">
            	<div align="center"><span class="STYLE4">
            		<a href="javascript:foreverdel('{$vo.card_id}');"><img src="__PUBLIC__/Images/del.gif" width="16" height="16" />删除</a></span>
            	</div>
            </td>
          </tr>
          </volist>
        </table></td>
        <td width="8" background="__PUBLIC__/Images/tab_15.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="35" background="__PUBLIC__/Images/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="__PUBLIC__/Images/tab_18.gif" width="12" height="35" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="STYLE4"><div class="green-black">{$page}</div></td>
          </tr>
        </table></td>
        <td width="16"><img src="__PUBLIC__/Images/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table></td>
  </tr>
</table>
 <form action="__URL__/delete" method="post" id="form1">
 	<input id = "id" name="id" type="hidden" value="" />
 </form>
 <form action="__URL__/outCsv" method="post" id="formCsv">
 	<input id = "card_id" name="card_id_c" type="hidden" value="" />
 	<input id = "card_password" name="card_password_c" type="hidden" value="" />
 	<input id = "card_amount" name="card_amount_c" type="hidden" value="" />
 	<input id = "card_generatedate" name="card_generatedate_c" type="hidden" value="" />
 </form>
</body>
</html>
